# @author zfd
# @date 2022年12月14日 11:31
# @desc 三次登录机会

username = 'admin'
password = 'admin'
max_times = 3

while max_times > 0:
    max_times -= 1
    name = input('your name:')
    pwd = input('your pwd:')
    if username == name and password == pwd:
        print('success')
        break
    else:
        print('failed')
        if max_times > 0:
            print(f'times {max_times} left')
        else:
            print('times 0')
